package org.car.world.service.impl;

import java.util.List;

import org.car.world.core.entily.OrderTable;
import org.car.world.core.mapper.OrderTableMapper;
import org.car.world.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;

@Service
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class OrderServiceImpl implements OrderService {


    @Autowired
    OrderTableMapper orderTableMapper;


    @Override
    public int deleteByPrimaryKey(Integer orderId) {
        return orderTableMapper.deleteByPrimaryKey(orderId);
    }


    @Override
    public int insert(OrderTable record) {
        return orderTableMapper.insert(record);
    }


    @Override
    public OrderTable selectByPrimaryKey(Integer orderId) {
        return orderTableMapper.selectByPrimaryKey(orderId);
    }


    @Override
    public List<OrderTable> selectAll() {
        return orderTableMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(OrderTable record) {
        return orderTableMapper.updateByPrimaryKey(record);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyDateList(Integer merchantsId, String orderdate) {
        return orderTableMapper.selectByPrimaryKeyDateList(merchantsId, orderdate);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyListLimit(Integer merchantsId, Integer form, Integer size) {
        PageHelper.startPage(form, size);
        return orderTableMapper.selectByPrimaryKeyList(merchantsId);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyList(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryKeyList(merchantsId);
    }


    @Override
    public int selectByPrimaryKeyListCount(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryKeyListCount(merchantsId);
    }


    @Override
    public int selectByPrimaryKeyDateListCount(Integer merchantsId, String orderdate) {
        return orderTableMapper.selectByPrimaryKeyDateListCount(merchantsId, orderdate);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyDateListLimit(Integer merchantsId, String orderdate, Integer form,
                                                            Integer size) {
        PageHelper.startPage(form, size);
        return orderTableMapper.selectByPrimaryKeyDateList(merchantsId, orderdate);
    }


    @Override
    public int selectByPrimaryListOkCount(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryListOkCount(merchantsId);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyListSta(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryKeyListSta(merchantsId);
    }


    @Override
    public int selectByPrimaryKeyListStaCount(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryKeyListStaCount(merchantsId);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyListNew(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryKeyListNew(merchantsId);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyListNewLimit(Integer merchantsId, Integer form, Integer size) {
        PageHelper.startPage(form, size);
        return orderTableMapper.selectByPrimaryKeyListNew(merchantsId);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyStaList(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryKeyStaList(merchantsId);
    }


    @Override
    public int selectByPrimaryListStaCount(Integer merchantsId) {
        return orderTableMapper.selectByPrimaryKeyListStaCount(merchantsId);
    }


    @Override
    public List<OrderTable> selectByPrimaryKeyListStaLimit(Integer merchantsId, Integer form, Integer size) {
        PageHelper.startPage(form, size);
        return orderTableMapper.selectByPrimaryKeyStaList(merchantsId);
    }

}
